﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Select.aspx.cs" Inherits="WebApplication1.Select" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>

    <style>
    .s
    {
        cursor:pointer;
    }
    
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:GridView ID="gvwDetails" runat="server" ShowFooter="true" AutoGenerateColumns="false" AllowPaging="true"
            Width="100%" OnRowCommand="gvwDetails_RowCommand" 
            onrowediting="gvwDetails_RowEditing" 
            onrowupdating="gvwDetails_RowUpdating" 
            onrowcancelingedit="gvwDetails_RowCancelingEdit" 
            onrowdeleting="gvwDetails_RowDeleting" 
            onpageindexchanging="gvwDetails_PageIndexChanging" PageSize="3">
            <Columns>
                <asp:TemplateField HeaderText="Sr.No">
                    <HeaderStyle HorizontalAlign="Center" />
                    <ItemStyle HorizontalAlign="Center" Width="10%" />
                    <ItemTemplate>
                        <%# Container.DataItemIndex+1 %>
                    </ItemTemplate>
                </asp:TemplateField>

                <asp:TemplateField HeaderText="Name">
                    <HeaderStyle HorizontalAlign="left" />
                    <ItemStyle HorizontalAlign="left" Width="25%" />
                    <ItemTemplate>
                        <asp:Label ID="lblName" runat="server" Text='<%# Bind("Name") %>'></asp:Label>
                    </ItemTemplate>
                    <EditItemTemplate>
                        <asp:TextBox ID="txtName" runat="server" Text='<%# Bind("Name") %>' Width="80%" MaxLength="49"></asp:TextBox>
                    </EditItemTemplate>
                    <FooterTemplate>
                        <asp:TextBox ID="txtNameF" runat="server" Text='<%# Bind("Name") %>'></asp:TextBox>
                    </FooterTemplate>
                </asp:TemplateField>

                <asp:TemplateField HeaderText="Age">
                    <HeaderStyle HorizontalAlign="left" />
                    <ItemStyle HorizontalAlign="left" Width="25%" />
                    <ItemTemplate>
                        <asp:Label runat="server" ID="lblAge" Text='<%# Bind("Age") %>'></asp:Label>
                    </ItemTemplate>
                    <EditItemTemplate>
                        <asp:TextBox ID="txtAge" runat="server" Text='<%# Bind("Age") %>' Width="80%" MaxLength="49"></asp:TextBox>
                    </EditItemTemplate>
                    <FooterTemplate>
                        <asp:TextBox ID="txtAgeF" runat="server" Text='<%# Bind("Age") %>' Width="80%" MaxLength="49"></asp:TextBox>
                    </FooterTemplate>
                </asp:TemplateField>

                <asp:TemplateField HeaderText="Address">
                    <HeaderStyle HorizontalAlign="left" />
                    <ItemStyle HorizontalAlign="left" Width="25%" />
                    <ItemTemplate>
                        <asp:Label ID="lblAddress" runat="server" Text='<%# Bind("Address") %>'></asp:Label>
                    </ItemTemplate>
                    <EditItemTemplate>
                        <asp:TextBox ID="txtAddress" runat="server" Text='<%# Bind("Address") %>' Width="80%"
                            MaxLength="49"></asp:TextBox>
                    </EditItemTemplate>
                    <FooterTemplate>
                        <asp:TextBox ID="txtAddressF" runat="server" Text='<%# Bind("Address") %>' Width="80%"
                            MaxLength="49"></asp:TextBox>
                    </FooterTemplate>
                </asp:TemplateField>

                <asp:TemplateField HeaderText="Add">
                    <HeaderStyle HorizontalAlign="Center" />
                    <ItemStyle HorizontalAlign="Center" Width="10%" />
                    <EditItemTemplate>
                        <asp:ImageButton ID="ibtnUpdate" runat="server"  CommandName="Update"  CommandArgument='<%#Eval("Id") %>' ImageUrl="~/update.png"/>
                        <asp:ImageButton ID="ibtnCancel" runat="server" CommandName="Cancel"/>
                    </EditItemTemplate>
                    <ItemTemplate> 
                        <asp:ImageButton ID="imgEdit" CssClass="s" runat="server" ImageUrl="~/edit.png" ToolTip="Edit" CommandName="Edit"  />
                    </ItemTemplate>
                    <FooterTemplate>
                        <center>
                            <asp:ImageButton ID="imgAdd" CssClass="s" runat="server" ImageUrl="~/add.gif" ToolTip="Add"
                                CommandName="Insert" CommandArgument='<%#Eval("Id") %>' CausesValidation="False" />
                        </center>
                    </FooterTemplate>
                </asp:TemplateField>


                <asp:TemplateField>
                <HeaderStyle  HorizontalAlign="Center"/>
                <ItemStyle HorizontalAlign="Center" Width="5%"/>
                <ItemTemplate>
                    <asp:ImageButton ID="ibtnDelete" runat="server" ImageUrl="~/delete1.jpg" CommandName="Delete" CommandArgument='<%# Eval("Id") %>'/>
                </ItemTemplate>
                </asp:TemplateField>

            </Columns>
        </asp:GridView>
        <asp:DropDownList ID="ddlName" runat="server" AutoPostBack="True">
        </asp:DropDownList>
    </div>
    </form>
</body>
</html>
